<template>
	<common-select
		v-model:data="state.data"
		:label="state.label"
		:value="state.value"
		:fields="state.columns"
		:tableData="state.table.data"
		:curPage="state.table.currentPage"
		:pageSize="state.table.pageSize"
		:total="state.table.total"
		:border="true"
		clearable
		editable
		@currentChange="currentChange"
		@sizeChange="sizeChange"
		@inputChange="inputChange"
		@blur="blurInput"
		@clear="clear"
		@handleRowClick="handleRowClick"
	></common-select>
</template>

<script setup lang="ts">
import {useBizSelect} from '../hooks/useBizSelect';
import CommonSelect from './commonSelect.vue';
import {checkstockHGetPageSet} from '/@/api/platform/mes/wmsCheckstock';

const emit = defineEmits(['change']);

const model = defineModel();

// 获取props中的参数
const props = defineProps({
  queryParams: {
    type: Object,
    default: () => {
    }
  }
});

const {state, inputChange, blurInput, currentChange, sizeChange, clear, handleRowClick} = useBizSelect({
  model: model,
  pageList: checkstockHGetPageSet,
  label: 'billCode',
  value: 'billCode',
  // queryParams: {status: 'Checking'},
  queryParams: props.queryParams || {},
  emit: emit,
  columns: [
    {label: '盘点单号', prop: 'billCode', width: 200},
    {label: '仓库名称', prop: 'warehouseName', width: 150},
    {label: '仓库代码', prop: 'warehouseCode', width: 150},
    {label: '状态', prop: 'status', width: 100},
    {label: '创建时间', prop: 'creationTime', width: 200},
  ],
});
</script>

<style scoped></style>
